let options = ["rock","paper","scissors"]
let score=0
let round=1
let keep=confirm("您想玩石头剪刀布吗?\n\t赢一局加10分，输一局扣5分")
let computer_option,player_option
while (keep){
    player_option=prompt("请输入您的选择\n\trock\n\tpaper\n\tscissors")
    computer_option=options[Math.floor(Math.random()*3)]
    if (options.indexOf(player_option)!=-1){
        if (player_option == computer_option){
            alert("平局\n目前总分是"+score.toString())
        }else if ((player_option == "paper" && computer_option == "rock")||
            (player_option == "rock" && computer_option == "scissors")||
            (player_option == "scissors" && computer_option == "paper")){
            score+=10
            alert("你赢了\n你出了"+player_option.toUpperCase()+" ,电脑出了"+computer_option.toUpperCase()+". "+"\n目前总分是 "+score.toString()+"\n目前是第"+round.toString()+"轮")
            round+=1
        }else{
            score-=5
            alert("你输了\n你出了"+player_option.toUpperCase()+" ,电脑出了"+computer_option.toUpperCase()+". "+"\n目前总分是 "+score.toString()+"\n目前是第"+round.toString()+"轮")
            round+=1
        }
    }else{
        alert("您的输入无效，请重试")
    }
    keep=confirm("你还想再来一局吗？")
}